import request from '@/utils/request'

// 获取列表数据
export function getList(data = {}) {
  return request({
    url: '/api/sczx/user/classOrg/list',
    method: 'POST',
    data,
  })
}

// 获取分页数据
export function getPageList(data?: any) {
  return request({
    url: '/api/sczx/user/classOrg/page',
    method: 'POST',
    data,
  })
}
// 获取树形数据
export const getTree = (data = {}) => {
  return request({
    url: '/api/sczx/user/classOrg/tree',
    method: 'POST',
    data,
  })
}
// 修改
export function doEdit(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/edit',
    method: 'POST',
    data,
  })
}

// 删除
export function doDelete(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/deleteById',
    method: 'POST',
    data,
  })
}
// 获取详情
export function getById(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/detailById',
    method: 'POST',
    data,
  })
}
// 批量删除
export function doDeleteList(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/batchDeleteByIds',
    method: 'POST',
    data,
  })
}
// 添加
export function doAdd(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/create',
    method: 'POST',
    data,
  })
}

// 批量添加
export function doAddList(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/batchCreate',
    method: 'POST',
    data,
  })
}

export function getGradeList(data?: any) {
  return request({
    url: '/api/sczx/user/classOrg/gradeList',
    method: 'POST',
    data,
  })
}

// 上传导入批量
export function doImport(data: any) {
  return request({
    url: '/api/sczx/user/classOrg/import',
    method: 'POST',
    header: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}
